home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
050
/
bix03.arc
/
PBIOS.SYS
< prev
next >
Wrap
Text File
|
1986-08-04
|
5KB
|
150 lines
(********************************************************************)
(* *)
(* PSEUDO ROM BIOS Access Procedures *)
(* *)
(* Calls PSEUDO-BIOS Routines for modification of screen *)
(* parameters. *)
(* *)
(* *)
(* written by: John Leonard 1/25/86 *)
(* *)
(* NOT FOR SALE WITHOUT WRITTEN PERMISSION *)
(* *)
(* *)
(********************************************************************)
function WOffSet( row, column: integer) : integer;
begin
WOffSet := ( row * DefaultWidth) shl 1 +
( column shl 1);
end;
function BlankLine( width: integer ) : Window_Big_String;
var i:integer;
temp : Window_Big_String;
begin
temp[0]:= char(width);
with currentscreendata do
for i := 0 to width do begin
temp[i*2+1] := char(filler);
temp[i*2+2] := char(attribute);
end;
blankline:= temp;
end;
procedure WSetCursorPosition( ipage,row,column:integer);
begin
with currentscreendata do with windowloc[ipage] do begin
xloc := column;
yloc := row;
end;
end;
procedure WReadCursorPosition(ipage : integer;
var irow,icolumn,is1,is2:integer);
begin
with currentscreendata do with windowloc[ipage] do begin
icolumn := xloc;
irow := yloc;
is1 := s1;
is2 := s2;
end;
end;
procedure WSetActiveDisplayPage( i : integer);
begin
CurrentScreenData.page := i;
end;
procedure WScrollWindowUp( lines,filler,y1,x1,y2,x2:integer);
var page,i,segment,width,oldoffset,newoffset : integer;
blank : Window_Big_String;
Lwidth: integer;
begin
page := currentscreendata.page;
Segment := seg(displaystack[page]^);
Width := (x2-x1+1) shl 1;
blank := BlankLine(width);
if lines = 0 then
for i := y1 to y2 do begin
oldoffset := woffset(i,x1);
move( blank[1],mem[segment:oldoffset],width );
{ fillchar( mem[segment:oldoffset],width,filler); }
end
else begin
for i := y1+lines to y2 do begin
OldOffset := woffset(i,x1);
NewOffset := woffset(i-lines,x1);
move( mem[segment:oldoffset],
mem[segment:newoffset],
Width);
end;
for i := y2-lines to y2 do begin
oldoffset := woffset(i,x1);
fillchar( mem[segment:oldoffset],width,filler);
end
end;
end;
procedure WScrollWindowDown( lines,filler,y1,x1,y2,x2:integer);
var i,segment,width,oldoffset,newoffset,page : integer;
begin
page := currentscreendata.page;
Segment := seg(displaystack[page]^);
Width := (x2-x1+1) shl 1;
if lines = 0 then
for i := y1 to y2 do begin
oldoffset := woffset(i,x1);
fillchar( mem[segment:oldoffset],width,filler);
end
else begin
for i := y2-lines downto y1 do begin
OldOffset := woffset(i,x1);
NewOffset := woffset(i+lines,x1);
move( mem[segment:oldoffset],
mem[segment:newoffset],
Width);
end;
for i := y1 to y1+lines do begin
oldoffset := woffset(i,x1);
fillchar( mem[segment:oldoffset],width,filler);
end
end;
end;
procedure WWriteCharacterAndAttribute( character,page,attribute,num:integer);
var segment,charoffset,i,j:integer;
begin
segment := seg(DisplayStack[page]^);
charoffset := woffset( currentscreendata.windowloc[page].yloc,
currentscreendata.windowloc[page].xloc);
for i := 0 to num-1 do begin
j := i shl 1;
DisplayStack[page]^[charoffset+j] := character;
DisplayStack[page]^[charoffset+1+j] := attribute;
end;
end;
procedure WWriteCharacter( character,page,num:integer);
var segment,charoffset,i,j:integer;
begin
segment := seg(DisplayStack[page]^);
charoffset := woffset( currentscreendata.windowloc[page].yloc,
currentscreendata.windowloc[page].xloc);
for i := 0 to num-1 do begin
j := i shl 1;
DisplayStack[page]^[charoffset+j] := character;
DisplayStack[page]^[charoffset+1+j] := DefaultAttribute;
end;
end;